package internal

type PhoneNumber struct {
	Number  string
	IDDCode string
}

func NewPhoneNumber(number, IDDCode string) *PhoneNumber {
	p := &PhoneNumber{}
	p.Number = number
	p.IDDCode = IDDCode
	return p
}

func (p *PhoneNumber) GetIDDCode() string {
	return p.IDDCode
}

func (p *PhoneNumber) GetNumber() string {
	return p.Number
}

func (p *PhoneNumber) GetUniversalNumber() string {
	return p.GetPrefixedIDDCode("+") + p.Number
}

func (p *PhoneNumber) GetZeroPrefixedNumber() string {
	return p.GetPrefixedIDDCode("00") + p.Number
}

func (p *PhoneNumber) GetPrefixedIDDCode(prefix string) string {
	if p.IDDCode != "" {
		return prefix + p.IDDCode
	}
	return ""
}